require 'logger'

require_relative 'gitee_transfer/config'
require_relative 'gitee_transfer/request'
require_relative 'gitee_transfer/git'
require_relative 'gitee_transfer/language'
require_relative 'gitee_transfer/namespace'
require_relative 'gitee_transfer/counter'
require_relative 'gitee_transfer/worker'

module GiteeTransfer
  class << self
    def configure
      yield config
    end

    def config
      @_config ||= Config.new
    end

    def logger
      @_logger ||= ::Logger.new(File.join(pwd, 'transfer.log'))
    end

    def counter
      @_counter ||= Counter.new
    end

    def execute(options = {})
      pwd
      Worker.new.execute(options)
    end

    def pwd
      @pwd ||= Dir.pwd
    end
  end
end
